package indi.jp.project.core.config;

import indi.jp.project.core.util.SerialUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * 序列号工具类
 *
 * @author jiangping
 * @date 2022/3/4
 */
@Configuration
public class SerialUtilConfig {

    @Resource
    private PropertyConfig propertyConfig;

    @Bean
    public SerialUtil serialUtil() {
        return new SerialUtil(propertyConfig.getSnowFlake().getDataCenterId(), propertyConfig.getSnowFlake().getMachineId());
    }

}
